﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using TopBuilds.Restaurant.Data;

namespace TopBuilds.Restaurant.ManagementClient
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private void OnActivate(object sender, EventArgs e)
        {
            if (System.Data.ConnectionState.Open != DatabaseObject.Instance.OpenDatabase())
            {
                System.Windows.MessageBox.Show("数据库打开失败.");
                Application.Current.Shutdown();
            }
        }

        private void OnDeactivate(object sender, EventArgs e)
        {
            // database
            DatabaseObject.Instance.CloseDatabase();
        }

    }
}
